<?php 
defined('IN_TS') or die('Access Denied.');
switch($ts){

	//支付记录
	case "list":

		$userid = intval($_GET['userid']);


		$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
		$url = SITE_URL.'index.php?app=pay&ac=admin&mg=log&ts=list&page=';
		$lstart = $page*20-20;

		$where = null;
		if($userid){


			$strPay = $new['pay']->find('pay',array(
				'userid'=>$userid,
			));


			$where = array(
				'userid'=>$userid,
			);
		}

		$arrLog = $new['pay']->findAll('pay_log',$where,'addtime desc',null,$lstart.',20');

		foreach($arrLog as $key=>$item){
			if($item['userid']){
				$arrLog[$key]['user'] = aac('user')->getOneUser($item['userid']);
			}
		}

		$logNum = $new['pay']->findCount('pay_log',$where);
		$pageUrl = pagination($logNum, 20, $page, $url);
	
		include template('admin/log_list');
		break;
	

	
}